package com.ruili.framework.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = "ruili")
public class RuiliConfig {

    /** 项目名称 */
    private String name;

    /** 版本 */
    private String version;

    private IpService ipService = new IpService();

    public static class IpService{
        /**
         * ip 查询的服务商
         */
        private String service;

        /**
         * 黑名单永久限制次数
         */
        private Integer foreverLimitNumber;

        /**
         * 黑名单临时限制时间间隔 单位分钟
         */
        private Integer temporaryLimitTime;

        /**
         * 黑名单临时限制次数
         */
        private Integer temporaryLimitNumber;


        /** 获取地址开关 */
        private boolean addressEnabled;

        public boolean isAddressEnabled() {
            return addressEnabled;
        }

        public void setAddressEnabled(boolean addressEnabled) {
            this.addressEnabled = addressEnabled;
        }

        public Integer getTemporaryLimitTime() {
            return temporaryLimitTime;
        }

        public void setTemporaryLimitTime(Integer temporaryLimitTime) {
            this.temporaryLimitTime = temporaryLimitTime;
        }

        public Integer getTemporaryLimitNumber() {
            return temporaryLimitNumber;
        }

        public void setTemporaryLimitNumber(Integer temporaryLimitNumber) {
            this.temporaryLimitNumber = temporaryLimitNumber;
        }

        public Integer getForeverLimitNumber() {
            return foreverLimitNumber;
        }

        public void setForeverLimitNumber(Integer foreverLimitNumber) {
            this.foreverLimitNumber = foreverLimitNumber;
        }

        public String getService() {
            return service;
        }

        public void setService(String service) {
            this.service = service;
        }
    }

    public IpService getIpService() {
        return ipService;
    }

    public void setIpService(IpService ipService) {
        this.ipService = ipService;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

}
